<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="java.util.ArrayList" %>
<%@ page import="com.net.test.vo.TVO" %>
<script>

function go_save(){
    var frm = document.writeFrm;
   
    /* frm.fileNmtxt.value = frm.fileNm.value; */
    if(!confirm("수정하시겠습니까?"))return;
    frm.action = "/tboardUpdate.ncb";
    frm.submit();    
}
</script>
  <%
  	String result = request.getAttribute("result") == null ? "" :(String)request.getAttribute("result");  
  	if(result.equals("1")){
  %>
  <script>
  	alert("수정됨");
  	location.href ="/tlogView.ncb";
  
  </script>
  
  <%
  }else if(!result.equals("") && !result.equals("1")){
  %>
  <script>
   alert("에러");
  
  </script>
  <%} %>
  
  
  
  <%    
  
  	TVO view = (TVO)request.getAttribute("edit");  
  	
  	String title = "";
  	String contents = "";
  	String new_name = "";
	String org_name = "";
	String seq = "";
  	
  	if(view != null){
  		title = view.getTitle() == null ? "" : view.getTitle();
  		contents = view.getContents() == null ? "" : view.getContents();
  		new_name = view.getNew_name() == null ? "" : view.getNew_name();
		org_name = view.getOrg_name() == null ? "" : view.getOrg_name();
		seq = view.getSeq() == null? "" : view.getSeq();
  	}
  %>

<br />
<h1>게시판 수정하기</h1> 
<br />

<form name="writeFrm" method="POST" >
	
    <input type="hidden" name="seq" value="<%=seq %>">
    
    
    

    <table border="1" style="width:650px;">
    
  
    
        <tr>
            <td>제목 :</td>
            <td><input type="text" name="title" style="width:98%;" value="<%=title %>"/></td>
        </tr>
        <tr>
            <td>내용 :</td>
            <td><textarea style="width:98%; height:200px;" name="contents" ><%=contents %></textarea></td>
        </tr>
        
        
    </table>
    
    <input type="button" value="등록" onclick="javascript:go_save();" />
    
    <br /><br /><br />

</form>